package com.example.demo.service;

import com.example.demo.dao.BaseDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author Gavin
 * @date 2020.08.03 16:44
 */
@Service
public class ServiceB {
    @Autowired
    private BaseDao bd;

    @Transactional(propagation = Propagation.NEVER)
    public void demoB() throws Exception {
        Map<String, String> user = new HashMap<>();
        user.put("username", "高嘉银1");
        user.put("password", "123456");
        bd.save("UserMapper.insertOneUser", user);
//        int i = 1 / 0;
    }
}
